#define _CRT_SECURE_NO_WARNINGS 1

#include"SList.h"

void TestSList1()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPushBack(&plist, 6);
	SLTPushBack(&plist, 7);
	SLTPushBack(&plist, 8);
	SLTPrint(plist);

	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 1);
	SLTPrint(plist);

	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPrint(plist);

	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPrint(plist);

	SLTNode* ret1 = SLTFind(plist, 2);
	SLTInsert(&plist, ret1, 20);
	SLTPrint(plist);

	SLTNode* ret2 = SLTFind(plist, 20);
	SLTErase(&plist,ret2);
	SLTPrint(plist);

	SLTNode* ret3 = SLTFind(plist, 2);
	SLTInsertAfter(ret3, 20);
	SLTPrint(plist);

	SLTNode* ret4 = SLTFind(plist, 2);
	SLTEraseAfter(ret4);
	SLTPrint(plist);
	SLTPrint(plist);
}

int main()
{
	TestSList1();
	return 0;
}